package com.ac.input.web.action.input;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.springframework.jdbc.core.JdbcTemplate;

import com.caac.core.web.action.BaseAction;
import com.caac.core.web.form.BaseForm;

public class ExecTmpAction extends BaseAction {
	protected ActionForward doExecute(ActionMapping mapping, BaseForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		String tmpId = request.getParameter("tmpId");
		String param = request.getParameter("params");
		String[] params = param.split(",");
		JdbcTemplate jt = this.getJdbcTemplate();
		String sql = "SELECT WR_CONT FROM HND_TMP_WHERE WHERE ID='" + tmpId
				+ "'";
		sql = (String) jt.queryForObject(sql, String.class);
		jt.update(sql, params);
		return forward(mapping);
	}
}